<template>
  <div class="channelList">
    <div class="top">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" size="mini" class="demo-ruleForm">
        <div style="display:flex">
          <el-form-item label="航空公司" prop="airlinerId" style="display:flex;margin:0 50px 0 0">
            <el-select clearable v-model="ruleForm.airlinerId" placeholder="请选择">
              <el-option v-for="item in airportLists" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="出票途径" style="display: flex; margin: 0 20px 0 0">
            <el-select clearable v-model="ruleForm.ticketingCChannel" placeholder="请选择">
              <el-option v-for="item in issuebill" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
        </div>
         <div style="display:flex;margin:15px 0 0 0">
          <el-form-item label="出发地：" prop="departure" style="display:flex;margin:0 50px 0 0">
              <el-select clearable v-model="ruleForm.departure" filterable placeholder="请选择">
                <el-option
                    v-for="item in CityList"
                    :key="item.airportId"
                    :label="item.airportCityName"
                    :value="item.airportId">
                  </el-option>
                </el-select>
          </el-form-item>
           <el-form-item label="到达地：" prop="arrival" style="display:flex;margin:0 50px 0 0">
              <el-select clearable v-model="ruleForm.arrival" filterable placeholder="请选择">
                <el-option
                    v-for="item in CityList"
                    :key="item.airportId"
                    :label="item.airportCityName"
                    :value="item.airportId">
                  </el-option>
                </el-select>
          </el-form-item>
       </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item label="舱位" prop='cabin' style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" type="textarea" :rows="1" v-model="ruleForm.cabin"></el-input>
          </el-form-item>
          <!-- <el-form-item
        prop="cityId"
          label="城市代码"
          style="display: flex; margin: 0 20px 0 0">
         <el-select v-model="ruleForm.cityId" placeholder="请选择">
            <el-option
              v-for="(item,index) in querySearch"
              :key="index"
              :label="item.label"
              :value="item.value">
            </el-option>
          </el-select>
        </el-form-item> -->
          <div style="color:red;font-size:13px;margin:4px 0 0 0">*多个舱位 | 分开</div>
        </div>
        <div style="display:flex; margin: 15px 0 0 0">
          <el-form-item prop="bigCustomer" label="大客户编码" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" type="textarea" :rows="1" v-model="ruleForm.bigCustomer"></el-input>
          </el-form-item>
          <el-form-item style="display: flex; margin: 0 20px 0 0">
            <el-checkbox v-model="ruleForm.isPnrrmk">是否需要在PNR中备注大客户编码</el-checkbox>
          </el-form-item>
        </div>
        <div style="display:flex; margin: 15px 0 0 0">
          <el-form-item label="适用开始时间" prop="starttime" style="display: flex; margin: 0 20px 0 0">
            <el-date-picker :value-format="format" v-model="ruleForm.startTime" type="datetime" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="适用结束时间" prop="endtime" style="display: flex; margin: 0 20px 0 0">
            <el-date-picker :value-format="format" v-model="ruleForm.endTime" type="datetime" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
        </div>
        <div style="display:flex; margin: 15px 0 0 0">
          <el-form-item label="航班开始时间" prop="starttime" style="display: flex; margin: 0 20px 0 0">
            <el-date-picker :value-format="format" v-model="ruleForm.flightdateSetOff" type="datetime"
              placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
          <el-form-item label="航班结束时间" prop="endtime" style="display: flex; margin: 0 20px 0 0">
            <el-date-picker :value-format="format" v-model="ruleForm.flightdateBack" type="datetime" placeholder="选择日期">
            </el-date-picker>
          </el-form-item>
          <!-- <el-form-item
              label="航班时间"
              prop="flightdate"
              style="display: flex; margin: 0 20px 0 0"> -->
          <!-- <el-date-picker
                v-model="ruleForm.flightdate"
                type="datetimerange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期">
              </el-date-picker> -->
          <!-- <el-date-picker
                  v-model="ruleForm.flightdate"
                  type="datetimerange"
                  range-separator="至"
                  start-placeholder="开始日期"
                  end-placeholder="结束日期">
                </el-date-picker>
           </el-form-item> -->
        </div>
        <div style="display:flex; margin: 15px 0 0 0">
          <el-form-item prop="orderSorce" label="订单来源" style="display: flex; margin: 0 20px 0 0">
            <el-checkbox-group v-model="ruleForm.orderSorce">
              <el-checkbox label="Telephone" name="checkList">电话</el-checkbox>
              <el-checkbox label="Online" name="checkList">网上</el-checkbox>
              <el-checkbox label="Phone" name="checkList">手机</el-checkbox>
              <el-checkbox label="Wap" name="checkList">wap</el-checkbox>
              <el-checkbox label="Agent" name="checkList">代理商</el-checkbox>
              <el-checkbox label="ShortMessage" name="checkList">短信</el-checkbox>
              <el-checkbox label="Import" name="checkList">导入</el-checkbox>
              <el-checkbox label="Trafree" name="checkList">TRAFREE</el-checkbox>
              <el-checkbox label="Travel" name="checkList">差旅</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </div>
        <div style="display:flex; margin: 15px 0 0 0">
          <el-form-item prop="deliceryType" label="配送方式" style="display: flex; margin: 0 20px 0 0">
            <el-checkbox-group v-model="ruleForm.deliceryType">
              <el-checkbox label="UrbanArea">市区送票</el-checkbox>
              <el-checkbox label="SendByPost">邮寄客票</el-checkbox>
              <el-checkbox label="DeliveryTicket">无需送票</el-checkbox>
              <el-checkbox label="Airport">机场取票</el-checkbox>
              <el-checkbox label="reserve">保留行程单</el-checkbox>
              <el-checkbox label="Itinerary">无需行程单</el-checkbox>
            </el-checkbox-group>
          </el-form-item>
        </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item prop="flightNo" label="航班号" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:300px" v-model="ruleForm.flightNo"></el-input>
          </el-form-item>
          <el-form-item prop="passengersrado" label="是否验证乘客" style="display: flex; margin: 0 20px 0 0">
            <el-radio-group v-model="ruleForm.isCheckInfo">
              <el-radio :label="2">是</el-radio>
              <el-radio :label="1">否</el-radio>
            </el-radio-group>
          </el-form-item>
        </div>
        <!-- <div style="display:flex;margin:15px 0 0 0">
           <el-form-item
          label="上传乘客"
          style="display: flex; margin: 0 20px 0 0">
         <el-input  style="width:550px" type="textarea" :rows="1" v-model="ruleForm.name"></el-input>
        </el-form-item>
        </div> -->
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item label="上传文件" style="display: flex; margin: 0 20px 0 0">
            <!-- :file-list="fileList" -->
            <el-upload class="upload-demo" action="/flight/adjust/flightAdjustPassengerVo"
              :on-success='uploadedsuccessfully' :on-preview="handlePreview" :on-remove="handleRemove"
              :before-remove="beforeRemove" multiple :limit="3" :on-exceed="handleExceed">
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip" style="color:red"> PS:文件格式 姓名 证件号 不能颠倒 姓名在前 证件号在后！！！！！！！</div>
            </el-upload>
          </el-form-item>
        </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item prop="issDesc" label="出票异常描述" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:300px" type="textarea" :rows="1" v-model="ruleForm.issDesc"></el-input>
          </el-form-item>
          <el-form-item prop="apply" label="是否适用所有乘客" style="display: flex; margin: 0 20px 0 0">
            <el-radio-group v-model="ruleForm.fitGuest">
              <el-radio :label="0">不适用</el-radio>
              <el-radio :label="1">适用</el-radio>
            </el-radio-group>
          </el-form-item>
        </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item prop="vippolicyType" label="返现类型" style="display: flex; margin: 0 20px 0 0">
            <el-radio-group v-model="ruleForm.vippolicyType">
              <el-radio :label="1">金额</el-radio>
              <el-radio :label="2">比例</el-radio>
            </el-radio-group>
          </el-form-item>
        </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item prop="vipPolicyAmount" label="数值(例如填8，当返现类型为金额时代表返现8元，当返现类型为比例时代表返现8%)"
            style="display: flex; margin: 0 20px 0 0">
            <el-input type="textarea" :rows="1" v-model="ruleForm.vipPolicyAmount"></el-input>
          </el-form-item>
        </div>
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item prop="cpMark" label="出票指令(多个用|隔开)" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" type="textarea" :rows="1" v-model="ruleForm.cpMark"></el-input>
          </el-form-item>
          <el-form-item label="PAT标示" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" type="textarea" :rows="1" v-model="ruleForm.patmark"></el-input>
          </el-form-item>
        </div>
        <!-- 大客户名单 -->
        <!--<div  style="display:flex;margin:15px 0 0 0" v-for="(item,index) in passengerListVoList" key="index">
           <el-form-item label="大客户姓名" style="display:flex;">
            <el-input v-model="item.name"></el-input>
          </el-form-item>
          <el-form-item label="大客户证件号" style="display:flex;margin:0 0 0 20px;">
            <el-input style="width:300px" v-model="item.cardId"></el-input>
          </el-form-item>
        </div>-->
        <div style="display:flex;margin:15px 0 0 0">
          <el-form-item style="margin:0 0 0 0">
            <el-button type="primary" @click="submitForm('ruleForm')">保存</el-button>
            <el-button @click="returnList">返回</el-button>
          </el-form-item>
        </div>

      </el-form>
      <!-- 表格 -->
    </div>
    <el-table v-if="auxiliary.length>0" @selection-change="handleSelectionChange" style="margin:40px 0 0 0"
      :header-cell-style="{
        color: '#fff',
        background: '#6090EC',
        fontSize: '11px',
        fontWeight: 'normal',
      }" :data="auxiliary" size="mini" border stripe>
      <el-table-column type="selection" width="100">
      </el-table-column>
      <!-- <el-table-column label="政策编号" prop="airportName" width="120" ></el-table-column> -->
      <el-table-column label="姓名" prop="name"></el-table-column>
      <el-table-column label="证件号" prop="cardId"></el-table-column>

    </el-table>
    <!-- 大客户表格 -->
    <el-table style="margin:40px 0 0 0" :header-cell-style="{
        color: '#fff',
        background: '#6090EC',
        fontSize: '11px',
        fontWeight: 'normal',
      }" :data="passengerListVoList" size="mini" border stripe>

      <el-table-column label="姓名" prop="name"></el-table-column>
      <el-table-column label="证件号" prop="cardId"></el-table-column>
      <el-table-column prop="10" label="操作" width="120">
        <template slot-scope="scope">
          <el-button type="primary" @click="handleClick(scope.row)" size="mini">修改</el-button>

        </template>
      </el-table-column>
    </el-table>
    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
      :page-sizes="[10, 15, 20]" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper"
      :total="pageTotal">
    </el-pagination>
    <!-- 修改弹窗 -->
    <el-dialog title="修改" :visible.sync="dialogVisible" width="50%">
      <el-form :model="information" :rules="rulesList" ref="information" size="mini" class="demo-ruleForm">
        <div style="display:flex">
          <el-form-item prop="name" label="姓名" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" v-model="information.name"></el-input>
          </el-form-item>
          <el-form-item prop="cardId" label="证件号" style="display: flex; margin: 0 20px 0 0">
            <el-input style="width:200px" v-model="information.cardId"></el-input>
          </el-form-item>
        </div>

        <el-form-item style="margin:30px 0 0 45%">
          <el-button type="primary" @click="informationdetermine('information')">确定</el-button>
          <el-button @click="dialogVisible=false">取消</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    name: 'channelList',
    data() {
      return {
        // 分页
        total: 0,
        pageSize: 10,
        currentPage: 1,
        pageTotal: 0,
        rowList: {},
        // 修改
        information: {
          name: "",
          cardId: ""
        },
        rulesList: {
          cardId: [{
            required: true,
            message: '请输入证件号',
            trigger: 'change'
          }, ],
          name: [{
            required: true,
            message: '请输入姓名',
            trigger: 'change'
          }, ],
        },
        dialogVisible: false,
        // 大客户列表返回
        passengerListVoList: [],
        // 大客户列表
        customersList: [],
        adjustId: "",
        format: "yyyy-MM-dd hh:mm:ss",
        flightAdjustPassengerList: [],
        // 出票途径
        issuebill: [{
            value: "1",
            label: "BPS"
          },
          {
            value: "2",
            label: "B2B"
          },
          {
            value: "3",
            label: "外购"
          },
          {
            value: "4",
            label: "航空直连"
          },
          {
            value: "5",
            label: "全部"
          },
          {
            value: "6",
            label: "三方协议"
          },
          {
            value: "7",
            label: "航司客服改期"
          }
        ],
        querySearch: [],
        //航空公司
        airportLists: [],
        // 下方表格
        auxiliary: [],

        ruleForm: {
          departure: "",
          arrival: "",
          endtime: "",
          fitGuest: 0,
          starttime: "",
          isCheckInfo: 1,
          vippolicyType: 1,
          // 适用乘客
          apply: 1,
          isPnrrmk: true,
          cashbacktype: 1,
          passengersrado: 1,
          deliceryType: [],
          orderSorce: [],
          checkList: [],
          cityId: '',
          airlinerId: "",
          cabin: "",
          ticketingChannel: "",
          flightdateSetOff: "",
          flightdateBack: "",
          ordersorce: "",
          deliverytype: "",
          bigcustomer: "",
          flightno: "",
          issDesc: "",
          vipPolicyAmount: "",
          cpMark: "",
          patMark: "",
        },
        // 校验
        rules: {
          airlinerId: [{
            required: true,
            message: '请选择航空公司',
            trigger: 'change'
          }, ],
          ticketingChannel: [{
            required: true,
            message: '请选择出票途径',
            trigger: 'change'
          }, ],
          cabin: [{
            required: true,
            message: '请输入舱位，用|隔开',
            trigger: 'blur'
          }, ],
          // cityId: [
          //   { required: true, message: '请选择城市', trigger: 'change' },
          // ],


          bigCustomer: [{
            required: true,
            message: '请输入大客户编码',
            trigger: 'change'
          }, ],
          //  starttime: [
          //   { type: 'date', required: true, message: '请选择开始时间', trigger: 'change' },
          // ],
          //  endtime: [
          //   { type: 'date', required: true, message: '请选择结束时间', trigger: 'change' },
          // ],
          //  flightdateSetOff: [
          //   { type: 'date', required: true, message: '请选择航班开始时间', trigger: 'change' },
          // ],
          //  flightdateBack: [
          //   { type: 'date', required: true, message: '请选择航班结束时间', trigger: 'change' },
          // ],
          orderSorce: [{
            type: 'array',
            required: true,
            message: '请选择订单来源',
            trigger: 'change'
          }, ],
          deliceryType: [{
            type: 'array',
            required: true,
            message: '请选择配送方式',
            trigger: 'change'
          }, ],
          flightNo: [{
            required: true,
            message: '请输入航班号',
            trigger: 'blur'
          }, ],

          //  passengersrado: [
          //   {  required: true, message: '请选择是否验证乘客', trigger: 'change' },
          // ],
          issDesc: [{
            required: true,
            message: '请输入出票异常描述',
            trigger: 'change'
          }, ],
          //  apply: [
          //   { required: true, message: '请选择是否适用所有乘客', trigger: 'change' },
          // ],
          //  cashbacktype: [
          //   { required: true, message: '请选择返现类型', trigger: 'change' },
          // ],

          vipPolicyAmount: [{
            required: true,
            message: '请输入数值',
            trigger: 'blur'
          }, ],
          cpMark: [{
            required: true,
            message: '请输入出票指令',
            trigger: 'blur'
          }, ],
          //  patMark: [
          //   { required: true, message: '请输入PAT标识', trigger: 'blur' },
          // ],

        },
      }
    },
    methods: {
      //跳出
      closeLoading() {
        this.tableLoading.close();
      },
      //进入
      showLoading() {
        this.tableLoading = this.$loading({
          text: "拼命加载数据中", //显示在加载图标下方的加载文案
          spinner: "el-icon-loading", //自定义加载图标类名
          background: "rgba(0, 0, 0, 0.4)", //遮罩层颜色
          target: document.querySelector("#table"), //loadin覆盖的dom元素节点
        });
      },
      // 分页
      handleSizeChange(value) {
        console.log("1", value);
        localStorage.setItem("pageSize", value);
        localStorage.setItem("pageNum", 1);
        this.getadjustPassengerVo();
        this.pageSize = value;
      },
      handleCurrentChange(value) {
        console.log("2", value);
        localStorage.setItem("pageNum", value);
        localStorage.setItem("pageSize", this.pageSize);
        this.getadjustPassengerVo();
        this.currentPage = value;
      },
      search() {
        localStorage.setItem("pageNum", this.currentPage);
        localStorage.setItem("pageSize", 10);
        this.getadjustPassengerVo();
      },
      // 大客户
      handleSelectionChangeList(passengerList) {
        console.log(passengerList)
      },
      handleSelectionChange(passengerList) {
        console.log(passengerList)
        this.flightAdjustPassengerList = passengerList
      },
      // 文件上传成功
      uploadedsuccessfully(row) {
        console.log(row)
        this.auxiliary = row.data
      },
      //文件上传 
      handleRemove(file, fileList) {
        console.log(file, fileList);
      },
      handlePreview(file) {
        console.log(file);
      },
      handleExceed(files, fileList) {
        this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
      },
      beforeRemove(file, fileList) {
        return this.$confirm(`确定移除 ${ file.name }？`);
      },
      dateChange(roq) {
        console.log(roq, this.ruleForm.starttime, )
      },
      // 获取城市列表
      getCityList() {
        this.$axios.postcityList().then((res) => {
         
           this.CityList = res.data
        });
      },
      // 修改接口
      getupdateAdjustPassengerVo() {
        this.showLoading()
        if (this.ruleForm.isPnrrmk == true) {
          this.ruleForm.isPnrrmk = '1'
        } else {
          this.ruleForm.isPnrrmk = '0'
        }
        // for(let i =0; i<this.ruleForm.cpMark.length;i++){
        //   // debugger
        // console.log(this.ruleForm.cpMark[0])
        //   console.log( this.ruleForm.cpMark)
        //   this.ruleForm.cpMark=this.ruleForm.cpMark[0]
        // }
        // console.log( this.ruleForm.cpMark)
        this.$axios.getupdateAdjustPassengerVo({
          adjustId:this.adjustId,
             departure:this.ruleForm.departure,
          // 出发地
          arrival:this.ruleForm.arrival,
          //抵达地
          isPnrrmk: this.ruleForm.isPnrrmk,
          // 航司三字码
          airlinerId: this.ruleForm.airlinerId,
          //  airlinerId:this.ruleForm.adjustId,
          // 舱位
          cabin: this.ruleForm.cabin,
          // 开始时间
          tmpStarttime: this.ruleForm.startTime,
          // 结束时间
          tmpEndtime: this.ruleForm.endTime,
          // 订单来源
          ordersorceList: this.ruleForm.orderSorce,
          // 配送方式,
          deliverytypeList: this.ruleForm.deliceryType,
          // 时间开始
          flightdateSetOff: this.ruleForm.flightdateSetOff,
          // 结束时间
          flightdateBack: this.ruleForm.flightdateBack,
          // 大客户编码
          bigcustomer: this.ruleForm.bigCustomer,
          // 航班号
          flightno: this.ruleForm.flightNo,
          // 是否验证白名单
          ischeckinfo: this.ruleForm.isCheckInfo,
          // 出票异常描述
          issDesc: this.ruleForm.issDesc,
          // 所有乘客
          fitGuest: this.ruleForm.fitGuest,
          // 返现类型
          vipPolicyType: String(this.ruleForm.vippolicyType),
          // 数值
          vipPolicyAmount: this.ruleForm.vipPolicyAmount,
          // 出票指令
          cpMark: this.ruleForm.cpMark,
          // pat价格
          patMark: this.ruleForm.patmark,
          // 出票途径
          ticketingChannel: this.ruleForm.ticketingCChannel,
          // 城市id
          // cityId:this.ruleForm.cityId,
          flightAdjustPassengerList: this.flightAdjustPassengerList
        }).then((res) => {
          this.closeLoading()
          console.log(res)
          if (res.code == '200') {
            this.$message({
              message: '修改成功',
              type: 'success'
            });
            this.$router.go(-1);
          } else {
            this.closeLoading()
            this.$message({
              message: '修改失败，请客对信息重新修改',
              type: 'warning'
            });
          }
        })
      },
      // 查询大客户
      getadjustPassengerVo() {
        this.showLoading()
        localStorage.setItem("pageNum", this.currentPage);
        localStorage.setItem("pageSize", this.pageSize);
        this.$axios.getadjustPassengerVo({
          id: String(this.adjustId)
          // id:'1053'
        }).then((res) => {
          this.closeLoading()
          console.log(res)
          if (res.code == '200') {
            this.pageTotal = res.total
            this.passengerListVoList = res.data
            console.log(this.passengerListVoList)
          }
        })
      },
      // 查询待修改
      getselectAdjustPassengerVo() {
        this.showLoading()
        this.$axios.getselectAdjustPassengerVo({
          id: String(this.adjustId)
        }).then((res) => {
          this.closeLoading()
          console.log(res)
          if (res.code == '200') {
            this.ruleForm = res.data
            this.ruleForm.isCheckInfo =  Number(res.data.isCheckInfo)
            this.ruleForm.fitGuest =  Number(res.data.fitGuest)
            this.ruleForm.vippolicyType =  Number(res.data.vippolicyType)
            this.ruleForm.cpMark = res.data.cpMark[0]
            this.ruleForm.airlinerId = Number(res.data.airlinerId)
          }
        })
      },
      // 返回按钮
      returnList() {
        this.$router.push({
          name: "adjustPassenger"
        })
      },
      // 新增确定按钮
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.getupdateAdjustPassengerVo()
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      // 修改大客户
      handleClick(row) {
        console.log(row)
        this.dialogVisible = true
        this.information = row
      },
      // 修改接口
      getupdatePassengerVo() {
        this.showLoading()
        this.$axios.getupdatePassengerVo({
          flightAdjustPassengerList: [{
            pId: this.information.pId,
            name: this.information.name,
            cardId: this.information.cardId
          }]
        }).then((res) => {
          this.closeLoading()
          console.log(res)
          if (res.code == '200') {
            this.$message({
              message: '修改成功',
              type: 'success'
            });
            this.dialogVisible = false
          } else {
            this.closeLoading()
            this.$message({
              message: '修改失败，请客对信息重新修改',
              type: 'warning'
            });
          }
        })
      },
      // 确认修改按钮
      informationdetermine(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            this.getupdatePassengerVo()
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      // 城市
      getselectCityList() {
        this.$axios.getselectCityList({

        }).then((res) => {
          console.log(res)
          if (res.code == '200') {
            let list = JSON.parse(JSON.stringify(res.data));
            this.querySearch = list.map((item) => {
              return {
                label: item.cityName,
                value: item.cityId
              };
            });
            console.log(this.querySearch);
          }
        })
      },
      // 航空公司列表
      getairportList() {
         localStorage.removeItem("pageSize");
        localStorage.removeItem("pageNum");
        this.$axios.getairportList({}).then((res) => {
          console.log(res);
          if (res.code == "200") {
            let list = JSON.parse(JSON.stringify(res.data));
            this.airportLists = list.map((item) => {
              return {
                label: item.airliner,
                value: item.id
              };
            });
            console.log(this.airportLists);
          }
            localStorage.setItem("pageSize", 10);
          localStorage.setItem("pageNum", 1);
        });
        // 
      },
    },
    mounted() {
      this.adjustId = this.$route.params.adjustId;
      console.log(this.adjustId);
    // 查询待修改
      this.getselectAdjustPassengerVo()
      // 城市
      this.getselectCityList()
      // 大客户
      this.getadjustPassengerVo()
      // 机票城市列表
      this.getCityList()
        // 航空公司
      this.getairportList()
    },
  }
</script>

<style scoped>
  .channelList {
    margin: 20px;
  }

  .top {
    display: flex;
    justify-content: center;
  }

  .customers {
    display: flex;
    justify-content: center;
  }
</style>